package com.dpj.threadpool;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.*;

@Slf4j(topic = "c.TestSubmit")
public class TestSubmit {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService pool = Executors.newFixedThreadPool(2);
        Future<String> future = pool.submit(()-> {

                Thread.sleep(1000);
                log.debug("running");
                return "ok";

        });
        log.debug("返回结果{}",future.get());



    }
}
